cmake_minimum_required(VERSION 3.15)
project(cppcoro_examples)

if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
    set(CPPCORO_EXAMPLE_OPTIONS -fcoroutines -Wall -Wextra -pipe)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
    set(CPPCORO_EXAMPLE_OPTIONS -Wall -Wextra -pipe)
else()
    message(FATAL_ERROR "Unsupported compiler.")
endif()

add_executable(coro_event coro_event.cpp)
target_link_libraries(coro_event PUBLIC cppcoro)
target_compile_options(coro_event PUBLIC ${CPPCORO_EXAMPLE_OPTIONS})